package sk.project.accounting.data.model;

// Generated Dec 17, 2012 9:50:06 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Address generated by hbm2java
 */
@Entity
@Table(name = "address", catalog = "skl_hosp_new")
public class Address implements java.io.Serializable {

	private Integer id;
	private Country country;
	private String street;
	private String city;
	private String zip;
	private Set<Company> companies = new HashSet<Company>(0);
	private Set<BranchOffice> branchOffices = new HashSet<BranchOffice>(0);

	public Address() {
	}

	public Address(Country country, String street, String city, String zip,
			Set<Company> companies, Set<BranchOffice> branchOffices) {
		this.country = country;
		this.street = street;
		this.city = city;
		this.zip = zip;
		this.companies = companies;
		this.branchOffices = branchOffices;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_country")
	public Country getCountry() {
		return this.country;
	}

	public void setCountry(Country country) {
		this.country = country;
	}

	@Column(name = "street", length = 100)
	public String getStreet() {
		return this.street;
	}

	public void setStreet(String street) {
		this.street = street;
	}

	@Column(name = "city", length = 100)
	public String getCity() {
		return this.city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	@Column(name = "zip", length = 5)
	public String getZip() {
		return this.zip;
	}

	public void setZip(String zip) {
		this.zip = zip;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "address")
	public Set<Company> getCompanies() {
		return this.companies;
	}

	public void setCompanies(Set<Company> companies) {
		this.companies = companies;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "address")
	public Set<BranchOffice> getBranchOffices() {
		return this.branchOffices;
	}

	public void setBranchOffices(Set<BranchOffice> branchOffices) {
		this.branchOffices = branchOffices;
	}

}
